<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<body>

<div id="app14">
    <p>Original message: "{{ message }}"</p>
    <!--所以，对于任何复杂逻辑，你都应当使用计算属性-->
    <p>Computed reversed message: "{{ reversedMessage }}"</p>
</div>

<script type="text/javascript">
    var vm = new Vue({
        el: '#app14',
        data: {
            message: 'Hello'
        },
        computed: {
            // 计算属性的 getter
            reversedMessage: function () {
                // `this` 指向 vm 实例
                return this.message.split('').reverse().join('')
            }
        }
    })
</script>
</body>
</html>